package com.zy.config;

import com.zy.bean.DataSource;
import com.zy.bean.User;
import org.springframework.context.annotation.*;

/**
 * @author LittleDesire
 * @description
 * @date 2022-03-29 周二 16:12
 * @since 17
 */
@Configuration
@ComponentScan(basePackages = {"com.zy.bean","com.zy.controller"})
public class ApplicationContext {

//    @Bean
//    @Conditional(MyCondition.class)
//    public User user() {
//        return new User();
//    }


    @Bean("ds")
    @Profile("dev")
    public DataSource devDataSource() {
        return new DataSource("http:dev", "root", "123");
    }


    @Bean("ds")
    @Profile("pro")
    public DataSource proDataSource() {
        return new DataSource("http:pro", "lili", "456");
    }
}
